home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
tcqbsnip.zip
/
SHUFFLE.BAS
< prev
next >
Wrap
BASIC Source File
|
1997-06-20
|
493b
|
20 lines
' SHUFFLE.BAS
' by Tika Carr
' (date unknown)
'
' Donated to the Public Domain
' No warranties or guarantees are expressed or implied.
'
' Purpose: Demonstrates how to make Pseudo-random numbers that don't repeat.
RANDOMIZE TIMER
DIM cards(52)
CLS
FOR i = 1 TO 52: cards(i) = i: NEXT 'load cards
FOR i = 1 TO 52 'randomize cards
r = RND * 51 + 1: SWAP cards(r), cards(i)
NEXT
FOR i = 1 TO 52: PRINT cards(i), : NEXT 'Print cards